package com.gitee.wsl.doc.rss

import kotlin.test.assertEquals

import kotlin.test.Test

class ParseV1Test {
    private  var feed: RSSFeedObject = ParseRSS.parse(Feed.rssV1Simple)
    private  var steamFeed: RSSFeedObject = ParseRSS.parse(Feed.rssV1Steam)


    @Test
    fun validVersion() {
        assertEquals(feed.version,RSSVersion.RSS_V1)
    }

    @Test
    fun validSimpleFeedAndItem() {
        assertEquals(feed.title,"XML.com")
        assertEquals(feed.link,"http://xml.com/pub")
        assertEquals(feed.items.size,2)
        assertEquals(feed.items[0].title,"Processing Inclusions with XSLT")
    }

    @Test
    fun validSteamFeedItem() {
        assertEquals(steamFeed.title,"Steam RSS News Feed")
        assertEquals(steamFeed.language,"en")
        assertEquals(feed.items.size,2)
        assertEquals(feed.items[0].title,"Processing Inclusions with XSLT")
    }
}